from nicegui import ui


@ui.page("/")
def page():
    ui.on("on_open_folder", lambda e: print(f"Opening folder with data: {e}"))

    ui.button(
        "Hello",
        on_click=lambda: ui.notification(
            message="Hello World",
            actions=[
                {
                    "label": "打开文件夹",
                    "color": "yellow",
                    ":handler": "()=> emitEvent('on_open_folder','some data');",
                }
            ],
        ),
    )


ui.run()
